package light.head.model.el;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.Formula;
/**
 * 试卷模板
 *
 */
@Entity
@Table
public class PaperTemplate implements Serializable{
	
	private static final long serialVersionUID = 9191538141701375104L;
	private Integer code;			// 流水号
	private String name;			// 模板名称
	private String remark;			// 备注 
	private Float score;			// 总分
	private Integer oc;				// 创建机构
	private Integer cu;				// 创建人
	private Date ct;				// 创建时间
	private Boolean deleted = false;		// 是否删除
	
	
	private String cun;				//创建人
	
	private List<PaperTemplateItem> list;
	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public String getName() {
		return name;
	}
	@Column
	public String getRemark() {
		return remark;
	}
	@Column
	public Float getScore() {
		return score;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	@Column(updatable = false, nullable = false)
	public Integer getCu() {
		return cu;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable = false, nullable = false)
	public Date getCt() {
		return ct;
	}
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Formula("(SELECT ui.realName FROM UserInfo ui WHERE ui.code = cu)")
	public String getCun() {
		return cun;
	}
	@Transient
	public List<PaperTemplateItem> getList() {
		return list;
	}
	
	
	
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public void setScore(Float score) {
		this.score = score;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setCu(Integer cu) {
		this.cu = cu;
	}
	public void setCt(Date ct) {
		this.ct = ct;
	}
	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	public void setCun(String cun) {
		this.cun = cun;
	}
	public void setList(List<PaperTemplateItem> list) {
		this.list = list;
	}
}
